package nuc.ss.wl.controller;

import nuc.ss.wl.dao.Backup_RestoreDao;
import nuc.ss.wl.dao.impl.Backup_RestoreDaoImpl;
import nuc.ss.wl.entity.CC;
import nuc.ss.wl.service.CCService;
import nuc.ss.wl.service.ClassService;
import nuc.ss.wl.service.impl.CCServiceImpl;
import nuc.ss.wl.service.impl.ClassServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class BackupServlet extends BaseServlet{
    public void backup(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Backup_RestoreDao backup = new Backup_RestoreDaoImpl();
        backup.backup("localhost","root","root","d:\\beifen\\","beifen","school_management");
        request.getRequestDispatcher("index.jsp").forward(request, response);
    }

    public void recover(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Backup_RestoreDao backup = new Backup_RestoreDaoImpl();
        backup.recover("d:\\beifen\\beifen.sql","localhost","school_management","root","root");
        request.getRequestDispatcher("index.jsp").forward(request, response);
    }
}
